package com.yaojiaxun.logisticsPlatformSystem.controller;

import com.yaojiaxun.logisticsPlatformSystem.entity.PlatformInfo;
import com.yaojiaxun.logisticsPlatformSystem.service.PlatformService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @Auther: yjx_j
 * @Date: 2019/2/19 13:40
 * @Description:
 */
@Controller
public class PlatformInfoController {
    @Autowired
    private PlatformService platformService;

    @RequestMapping("/platform_manage")
    public String platformManage(Map<String, Object> map){
        map.put("platformInfo", platformService.findPlatformInfo());
        return "system/platform/platform_manage";
    }

    @RequestMapping("/updatePlatformInfo")
    public String platformUpdate(PlatformInfo platformInfo, Map<String, Object> map){
        platformService.updatePlatformInfo(platformInfo);
        map.put("platformInfo", platformService.findPlatformInfo());
        return "redirect:/platform_manage";
    }

    //客户点击联系我们topbar
    @RequestMapping("/logisticsPlatform/contact_us")
    public String contactUs(Map<String, Object> map){
        map.put("platformInfo", platformService.findPlatformInfo());
        return "front/platform/platform_index";
    }
}
